/******************************************************************************
 Copyright (c) 2024 Qualcomm Technologies International, Ltd.
 All Rights Reserved.
 Qualcomm Technologies International, Ltd. Confidential and Proprietary.

******************************************************************************/
#include "service_handle.h"
#include "gatt_ots_client_private.h"
#include "gatt_ots_client_handover.h"

CsrBool gattOtsClientHandoverVeto(ServiceHandle svcHandle)
{
    GOTSC *gattOtsClient = ServiceHandleGetInstanceData(svcHandle);
    CsrBool veto = FALSE;

    if (gattOtsClient)
    {
        if (gattOtsClient->writeCccCount                      ||                       /* CCCD write for characteristics is in process */
            gattOtsClient->pendingCmd != OTSC_PENDING_OP_NONE ||                       /* Any OTS procedure is in progress */
            SynergySchedMessagesPendingForTask(GATT_OTS_CLIENT_IFACEQUEUE, NULL) != 0) /* Any pending msg in schedular for OTS to handle */
        {
            veto = TRUE;
        }
    }

    GATT_OTS_CLIENT_INFO("GOTSC : gattOtsClient veto(%d) !", veto);

    return (veto);
}

